package org.dromara.system.domain.bo;

import org.dromara.system.domain.SysSocialUser;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

/**
 * 第三方登录业务对象 sys_social_user
 *
 * @author Lion Li
 * @date 2024-12-23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SysSocialUser.class, reverseConvertGenerate = false)
public class SysSocialUserBo extends BaseEntity {

    /**
     * 用户唯一标识
     */
    @NotBlank(message = "用户唯一标识不能为空", groups = { AddGroup.class, EditGroup.class })
    private String openid;

    /**
     * 用户id
     */
    private String user_id;

    /**
     * 用户类型
     */
    private Long user_type;

    /**
     * 用户名称
     */
    private String user_name;


    public SysSocialUserBo() {

    }

    public SysSocialUserBo(SysSocialUser sysSocialUser) {
        this.openid = sysSocialUser.getOpenid();
        this.user_id = sysSocialUser.getUserId();
        this.user_type = sysSocialUser.getUserType();
        this.user_name = sysSocialUser.getUserName();
    }
}
